import {callAjax} from '@/util/ajax/index.js'
let addressService = {
	addAddress : function(addressInfo, resolve, reject){
        callAjax({
            url     : '/shipping/add.do',
            data    : addressInfo,
            success : resolve,
            error   : reject
        });
    },
    updateAddress : function(addressInfo, resolve, reject){
        callAjax({
            url     : '/shipping/select.do',
            data    : addressInfo,
            success : resolve,
            error   : reject
        });
    },
    getAddressList : function(resolve, reject){
        callAjax({
            url     : '/shipping/list.do',
            data    : {
                pageSize : 50
            },
            success : resolve,
            error   : reject
        });
    },
    getAddress : function(shippingId, resolve, reject){
        callAjax({
            url     : '/shipping/select.do',
            data    : {
                shippingId : shippingId
            },
            success : resolve,
            error   : reject
        });
    },
    deleteAddress : function(shippingId, resolve, reject){
        callAjax({
            url     : '/shipping/del.do',
            data    : {
                shippingId : shippingId
            },
            success : resolve,
            error   : reject
        });
    },
}
export default addressService